package com.pi.shisan;

import com.pi.shisan.service.schedule.LoadingComponent;
import com.pi.shisan.service.util.ComponentManager;
import com.pi.shisan.util.spipoint.MergedSpi;
import com.pi.shisan.util.spipoint.MultipleFlushSpi;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;

@SpringBootApplication
@MapperScan("com.pi.shisan.service.mapper")
@ComponentScan({"com.pi.shisan.web","com.pi.shisan.service","com.pi.shisan.real.config"})
public class LedWebApplication {

    private static MultipleFlushSpi mergedSpi;

    public static void main(String[] args) {
        mergedSpi = new MultipleFlushSpi(new MergedSpi(4,3,true));
        mergedSpi.init();
        LoadingComponent.showOnce(mergedSpi);
        SpringApplication.run(LedWebApplication.class, args);
    }

    public static MultipleFlushSpi getMergedSpi() {
        return mergedSpi;
    }
}
